#{set title:'Extranet' /} 
#{extends 'main.html' /}

#{if flash.success}
<div class="alert alert-success" align=center>
<a class=close data-dismiss="alert">x</a>
   <b> <p class="success">${flash.success}</p> </b>
</div> 
#{/if}

<!-- barra superior. codigo para mostrar o nome do usuario logado -->
<div class="navbar navbar-fixed-top">
	<div class="navbar-inner">
		<div class="container">
			<a class="btn btn-navbar" data-toggle="collapse"
				data-target=".nav-collapse"> <span class="icon-bar"></span> <span
				class="icon-bar"></span> <span class="icon-bar"></span>
			</a> <a class="brand" align="center"> &nbsp; EXTRANET - Sistema de
				Controle de Tarefas</a>
			<div>
				<ul class="nav pull-right">

					<li class="dropdown"><a href="#" class="dropdown-toggle"
						data-toggle="dropdown"> Ola, <b>${user}</b> <b class="caret"></b>
					</a>
						<ul class="dropdown-menu">
							<li><a href="@{Application.logout()}"> <i
									class="icon-off"></i> Sair
							</a></li>
						</ul></li>
				</ul>
			</div>
		</div>
	</div>
</div>


<br><br><br>
<br>
<label align=center style="width:80%"> <h3> Detalhes da Tarefa </h3> </label>

#{list tarefa, as:'t'}
<label><b>Cliente: </b>${t.projeto.cliente.nome}</label>
<label><b>Projeto: </b>${t.projeto.nomeProjeto}</label>
<label><b>Tarefa: </b>${t.tituloTarefa}</label>
<label><b>Tipo Tarefa: </b>${t.tipoTarefa}</label>
<label><b>Status Tarefa: </b>${t.status}</label>


	<label><b>Concluido:</b>
			${t.porcentagem.format('00.0')}%
	</label>

<br />
<br />

<label><h3>Descri&ccedil;&atilde;o:</h3></label>
	<table class="table table-striped table-bordered table-condensed" style="width:80%">
		<tr style="width:80%">
			<th><h4>${t.descricao}</h4></th>
		</tr>
	</table>
#{if tipoUsuario == "funcionario"}
	<table>
		<tr>
			<td>#{form @LogsTarefa.logTarefa(t.id)} <!--  <input type="submit" value="Adionar Log" />  -->
				<button class="btn btn-primary" type="submit">Adicionar Log
				</button> #{/form}
			</td>
			<td>&nbsp &nbsp &nbsp</td>
		
			<td>#{form @Tarefas.concluirTarefa(t.id)}
				<button class="btn btn-danger" type="submit"
					id="btnFinalizar${t.id}">Concluir</button> #{/form}
			</td>
			
		</tr>

	</table>
#{/if}
	#{/list} 
	
<label align=center style="width:80%"> <h3> Logs </h3> </label>

		<table class="table table-striped table-bordered table-condensed" style="width:80%">
			#{list log, as:'l'}
			<tr>
				<th><div align="right">${l.data}</div> ${l.log}
					<div align="right">${l.hora}:${l.minuto} hs</div></th>
			</tr>
			#{/list}
		</table>